<?php
namespace Menu\Model;
use Think\Model;
class JournalModel extends Model {
	public function Create(){
		$data['title'] = I('post.title');
		$data['author'] = I('post.author');
		$data['content'] = I('post.content');
		$data['keywords'] = I('post.keywords');
		$data['desc']       = I('post.desc');
		$data['addtime']     = time();
		if($this->add($data)){
			$array['info']    = "添加成功";
			$array['number']  = 1;
		}
		return $array;
	}

	public function GetList(){
		$count      = $this->count();// 查询满足要求的总记录数
		$Page       = new \Think\Page($count,10);// 实例化分页类 传入总记录数和每页显示的记录数(25)
		$show       = $Page->show();// 分页显示输出
		// 进行分页数据查询 注意limit方法的参数要使用Page类的属性
		$list = $this->limit($Page->firstRow.','.$Page->listRows)->select();
		$data['list'] = $list;
		$data['page'] = $show;
		return $data;
	}
}